package com.hsj.feign.service;

import dto.TransData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import pojo.User;

/**
 * @author:Teacher黄
 * @date:Created at 2020/01/01
 */
@FeignClient(value = "SERVICE01",fallbackFactory = FeignServiceCallBack.class)
public interface FeignService {

    @GetMapping("/service01/hello")
    String hello();

    @GetMapping("/service01/get/{userName}")
    TransData getData(@PathVariable String userName);

    @PostMapping("/service01/post")
    TransData postData(@RequestBody String userName);

    @PostMapping("/service01/user")
    TransData postUser(@RequestBody User user);

}
